package com.lh.sericefeign;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;


@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class ServiceFeignApplication {
    public static void main(String[] args) {
        final ConfigurableApplicationContext run = new SpringApplicationBuilder(ServiceFeignApplication.class)
                .web(WebApplicationType.SERVLET)
                .run(args);
        final String port = run.getEnvironment().getProperty("server.port");
        System.out.println(String.format("http://localhost:%s/swagger-ui.html", port));
    }

}
